#coding:utf-8
from django.http import Http404, HttpResponse
from django.shortcuts import render_to_response
from palmgo.models import user1
import datetime

def hours_ahead(request, offset):
    try:
       offset = int(offset)
    except ValueError:
        raise Http404()

    dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
    html = "<html><body>In %s hour(s), it will be %s.</body></html>" % (offset, dt)
    list1=xrange(5)
    address = [
        {'name':'张三', 'address':'地址一'},
        {'name':'李四', 'address':'地址二'}
    ]
    u= user1.objects.filter(title__icontains='test')
    print type(u),u
    return render_to_response('datetime_view.html',{'hour_offset':offset,'next_time':dt,'moban':'city_siweiq4.html','list':list1,'address':u})
